package com.sishuok.jmstest.spring;

import javax.annotation.Resource;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Service;
@Service
public class QueueReceiver {
	@Resource
	private JmsTemplate jmsTemplate;
	public static void main(String[] args) {
		ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
		QueueReceiver queueReceiver = ctx.getBean(QueueReceiver.class);
		String msg = (String) queueReceiver.jmsTemplate.receiveAndConvert();
		System.out.println("msg==="+msg);
	}
}
